import request from '@/utils/request.js'

export const userRegisterService = (registerData) => {
    const params = new URLSearchParams()
    for (let key in registerData) {
        params.append(key, registerData[key]);
    }
    return request.post('/teacher/register', params);
}

export const userLoginService = (loginData) => {
    const params = new URLSearchParams();
    for (let key in loginData) {
        params.append(key, loginData[key])
    }
    return request.post('/teacher/login', params)
}

export const userInfoService = () => {
    return request.get('/teacher/userInfo')
}

export const userInfoUpdateService = (userInfo) => {
    return request.put('/teacher/update', userInfo)
}

export const updatePwdService = (pwdInfo) => {
    return request.patch('/teacher/updatePwd', pwdInfo)
}

export const teachersListService = ()=>{
    return request.get('/teacher/list')
}